<div id="todo_new_action">
  <%= form_for(todo, :html=> { :id=>'todo-form-new-action', :name=>'todo', :class => 'inline-form new_todo_form' }) do |t|%>
    <input id="default_project_name_id" name="default_project_name" type="hidden" value="<%= h(@initial_project_name)-%>" />
    <input id="default_context_name_id" name="default_context_name" type="hidden" value="<%= h(@initial_context_name)-%>" />
    <input type="hidden" id="new_todo_starred" name="new_todo_starred" value="false" />

    <div id="error_status">
      <%= get_list_of_error_messages_for(todo) %>
    </div>

    <div class="form-group">
      <label for="todo_description" style="float:left"><%= Todo.human_attribute_name('description') %></label>
      <a href="#" id="new_todo_starred_link" class="undecorated_link" ><%= image_tag("blank.png", :title =>t('todos.star_action'), :class => "todo_star", :style=> "float: right")%></a>
      <%= t.text_field("description", "size" => 30, "maxlength" => 100, "autocomplete" => "off", :autofocus => true, :class => "form-control input-sm") %>
    </div>

    <div class="form-group">
      <label for="todo_notes"><%= Todo.human_attribute_name('notes') %></label>
      <%= t.text_area("notes", "cols" => 29, "rows" => 6, :class => "form-control input-sm") %>
    </div>

    <div class="form-group">
      <label for="todo_project_name"><%= Todo.human_attribute_name('project') %></label>
      <input class="form-control input-sm" id="todo_project_name" name="project_name" autocomplete="off" size="30" type="text" value="<%= h(@initial_project_name) %>" />
      <div class="page_name_auto_complete" id="project_list" style="display:none"></div>
    </div>

    <div class="form-group">
      <label for="todo_context_name"><%= Todo.human_attribute_name('context') %></label>
      <input class="form-control input-sm" id="todo_context_name" name="context_name" autocomplete="off" size="30" type="text" value="<%= h(@initial_context_name) %>" />
    </div>

    <div class="form-group">
      <label for="tag_list"><%= Todo.human_attribute_name('tags') + ' (' + t('shared.separate_tags_with_commas') + ')' %></label>
      <%= hidden_field_tag "initial_tag_list", @initial_tags%>
      <%= text_field_tag "tag_list", @initial_tags, :size => 30, :class => "form-control input-sm" %>
      <%= content_tag("div", "", :id => "tag_list_auto_complete", :class => "auto_complete") %>
    </div>

    <div class="form-group">
      <div class="due_input">
        <label for="todo_due"><%= Todo.human_attribute_name('due') %></label>
        <%= t.text_field("due", "size" => 12, "class" => "Date form-control input-sm", "autocomplete" => "off") %>
      </div>

      <div class="show_from_input">
        <label for="todo_show_from"><%= Todo.human_attribute_name('show_from') %></label>
        <%= t.text_field("show_from", "size" => 12, "class" => "Date form-control input-sm", "autocomplete" => "off") %>
      </div>
    </div>

    <div class="depends_on">
      <div class="form-group">
        <label for="predecessor_ul"><%= Todo.human_attribute_name('predecessors')%></label>
        <div class="selected_predecessors">
          <ul class="predecessor_list" id="predecessor_ul" style="display:none">
          </ul>
        </div>
        <label id="label_for_predecessor_input" for="predecessor_input" style="display:none"><%= t('todos.add_another_dependency')%></label>
        <%= text_field_tag "predecessor_input", nil, :size => 30, :class => "form-control input-sm" %>
      </div>
      <%= hidden_field_tag "predecessor_list", ""%>
    </div>

    <%= source_view_tag( @source_view ) %>
    <%= hidden_field_tag :_tag_name, @tag_name.underscore.gsub(/\s+/, '_') if source_view_is :tag %>

    <button type="submit" class="btn btn-success" id="todo_new_action_submit">
      <%= t('shared.add_action') %>
    </button>

  <% end # form_for -%>
</div>
